package com.share.feign;

import com.share.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * name相同可以用contextId标识，配置文件添加spring.main.allow-bean-definition-overriding=true的配置也行，否则报错 bean加载的名称相同报错
 * created by caifan 2018/06/06
 */
@FeignClient(value = "microservice-provider-user", contextId = "user"/*, configuration = FeignConfiguration.class, fallback = UserFeignFallback.class, fallbackFactory = UserFeignFallbackFactory.class*/)
public interface UserFeignClient {
    @RequestMapping(value = "/rest/user/{id}", method = RequestMethod.GET)
    User getUserById(@PathVariable(value = "id")Long id);
}
